package kit.msc.utility;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.text.DecimalFormat;

public class ScreenSize {

	int iHeight, iWidth;
	double dHeight, dWidth;

	DecimalFormat twoDForm;

	public ScreenSize() {
		iWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth());
		iHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight());

		twoDForm = new DecimalFormat("#");
	}

	public int getScaledWidth(double dScale) {
		dWidth = Double.valueOf(twoDForm.format(iWidth * dScale));
		return (int) dWidth;
	}

	public int getScaledHeight(double dScale) {
		dHeight = Double.valueOf(twoDForm.format(iHeight * dScale));
		return (int) dHeight;
	}

	public Dimension getScaledDimension(double dScale) {
		dWidth = Double.valueOf(twoDForm.format(iWidth * dScale));
		dHeight = Double.valueOf(twoDForm.format(iHeight * dScale));
		return new Dimension((int) dWidth, (int) dHeight);
	}

}
